package com.globalwave.common.entity;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public abstract class AttributeBase {

    abstract protected AttributeBase newAttribute(Map.Entry<String, Object> entity, Long referenceId) ;

    public List<AttributeBase> newAttributes(Map<String, Object> entitys, Long referenceId) {
    	List<AttributeBase> result = new ArrayList<AttributeBase>(entitys.size()) ;
    	
    	for (Map.Entry<String, Object> entity:entitys.entrySet()) {
    		result.add(newAttribute(entity, referenceId)) ;
    	}
    	
    	return result ;
    }
}
